<include file="public/layout" />
<script src="__ROOT__/public/static/js/layer/laydate/laydate.js"></script>
<body style="background-color: #FFF; overflow: auto;"> 
<div class="page">
  <div class="fixed-bar">
    <div class="item-title"><a class="back" href="javascript:history.back();" title="返回列表"><i class="fa fa-arrow-circle-o-left"></i></a>
      <div class="subject">
        <h3> 礼券详情</h3>
        <h5>礼券添加与编辑</h5>
      </div>
    </div>
  </div>
    <!--表单数据-->
    <form method="post" id="handleposition" action="{:U('Admin/Coupon/couponinfo')}">  
    <div class="ncap-form-default">
      <dl class="row">
        <dt class="tit">
          <label><em>*</em>礼券名称：</label>
        </dt>
        <dd class="opt">
          <input type="text" placeholder="名称" class="input-txt" name="cname" value="{$info.cname|default='自定义礼券名称'}">
		  <span class="err" id="err_cname" style="color:#F00; display:none;">礼券名称不能为空</span>                                                  
          <p class="notic"></p>
        </dd>
      </dl>	   
	  
	  <dl class="row">
        <dt class="tit">
          <label>礼券介绍：</label>
        </dt>
        <dd class="opt">
          <textarea rows="3" cols="80" name="message" class="input-txt">{$info.message}</textarea>
		  <span class="err" id="err_message" style="color:#F00; display:none;"></span>                                                  
          <p class="notic"></p>
        </dd>
      </dl>	
      
      <dl class="row">
        <dt class="tit">
          <label><em>*</em>使用后多少天开始生效：</label>
        </dt>
        <dd class="opt">
          <input type="text" placeholder="0" class="input-txt" name="starttime" value="{$info.starttime/(24*60*60)}">
		  <span class="err" id="err_starttime" style="color:#F00; display:none;"></span>                                                  
          <p class="notic"></p>
        </dd>
      </dl>	
      
      <dl class="row">
        <dt class="tit">
          <label><em>*</em>有效时长(天)：</label>
        </dt>
        <dd class="opt">
          <input type="text" placeholder="30" class="input-txt" name="endtime" value="{$info.endtime/(24*60*60)}">
		  <span class="err" id="err_endtime" style="color:#F00; display:none;"></span>                                                  
          <p class="notic"></p>
        </dd>
      </dl>	
      
      <dl class="row">
        <dt class="tit">
          <label>礼券图片</label>
        </dt>
        <dd class="opt">
          <div class="input-file-show">
                <span class="show">
                    <a id="img_a" target="_blank" class="nyroModal" rel="gal">
                      <i id="img_i" class="fa fa-picture-o" onmouseover="layer.tips('<img src=__PUBLICROOT__{$info.iconurl}>',this,{tips: [1, '#fff']});" onmouseout="layer.closeAll();"></i>
                    </a>
                </span>
   	            <span class="type-file-box">
                    <input type="text" id="iconurl" name="iconurl" value="{$info.iconurl}" class="type-file-text">
                    <input type="button" name="button" id="button1" value="选择上传..." class="type-file-button">
                    <input class="type-file-file" onClick="GetUploadify(1,'','coupon','img_call_back')" size="30" hidefocus="true" nc_type="change_site_logo" title="点击前方预览图可查看大图，点击按钮选择文件并提交表单后上传生效">
                </span>
          </div>
          <span class="err"></span>
          <p class="notic">请上传图片格式文件,建议图片尺寸1:1(宽*高, 如果不按要求上传图片将会导致前端广告显示不友好)</p>
        </dd>
      </dl>
      
      
      <div class="bot"><a href="JavaScript:void(0);" onclick="adsubmit()" class="ncap-btn-big ncap-btn-green" id="submitBtn">确认提交</a></div>
    </div>
       <input type="hidden" name="id" value="{$info.id}">
  </form>
</div>
 <script>
	 function adsubmit(){
	 	var urls = "{:U('Admin/Coupon/couponinfo')}";
     	ajax_submit_form('handleposition',urls);
	}
	
     function img_call_back(fileurl_tmp)
     {
       $("#iconurl").val(fileurl_tmp);
       var showurl = localUrl + fileurl_tmp;
       $("#img_i").attr('onmouseover', "layer.tips('<img src="+ showurl+">',this,{tips: [1, '#fff']});");
     }
     
 </script>
</body>
</html>